package com.neusoft.elm.service.impl;

import com.neusoft.elm.dao.FoodDao;
import com.neusoft.elm.dao.impl.FoodDaoImpl;
import com.neusoft.elm.po.Business;
import com.neusoft.elm.po.Food;
import com.neusoft.elm.service.FoodService;
import com.neusoft.elm.util.DBUtil;

import java.util.List;

public class FoodServiceImpl implements FoodService {
    FoodDao foodDao = new FoodDaoImpl();

    @Override
    public List<Food> listFoodByBusinessId(Integer businessId) throws Exception {
        try {
            DBUtil.getConnection();
            List<Food> list = foodDao.listFoodByBusinessId(businessId);
            return list;
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        } finally {
            DBUtil.close();
        }
    }

    @Override
    public List<Business> listBusinessByOrderTypeId(Integer businessId) {
        return null;
    }
}
